#include "chatapp.h"
#include "sqlite3.h"

int
main (int argc, char *argv[])
{
	g_setenv ("GSETTINGS_SCHEMA_DIR", ".", FALSE);
	g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);

  int rc = 0;
  void *sql = NULL;

  rc = sqlite3_open("test.db", &sql);
  if (rc != SQLITE_OK) {
    return 1;
  }
  sqlite3_exec(sql, " \
  CREATE TABLE account ( \
    id       INT     PRIMARY KEY \
                     UNIQUE, \
    pwd      STRING, \
    ip       STRING, \
    nickname STRING, \
    token    STRING, \
    time     INTEGER, \
    contact  STRING, \
    email    STRING, \
    socket   STRING, \
    sys_type STRING \
);", NULL, NULL, NULL);
  sqlite3_close(sql);
  return 1;
	return g_application_run (G_APPLICATION (chat_app_new ()), argc, argv);
}
